<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<!-- 
			multiple="multiple"		多选
			accept="image/*"		文件类型图片
		 -->
		<input type="file" multiple="multiple" accept="image/*" onchange="aaa()">
		<hr>
		
		
		<!-- <a href="https://img.kags.com/static/img/uploads/20190818/310fb1dc93dad4e0f8e0cf9bd8c0efef14db421a.jpg" download="">下载图片</a> -->
		<hr >
		
		<button type="button" onclick="bbb()">下载zip</button>
	</body>
</html>

<script type="text/javascript">
	aaa = () => {
		var fileDom = document.querySelector('input[type=file]')
		// 获取得到file 对象
		var file = fileDom.files[0]
		console.log(file)
		
		// 获得blob
		var imgUrl = window.URL.createObjectURL(file)
		console.log(imgUrl);

		// blob 转 base64
		if(window.FileReader) {
			var reader  = new FileReader()
			reader.readAsDataURL(file)
			
			reader.addEventListener("load", function () {
				console.log(reader.result)
			}, false)
		}else {
			alert('Not supported by your browser!')
		} 
	}
	
	
	bbb = () => {
		window.open("https://codeload.github.com/douban/douban-client/legacy.zip/master")
	}
</script>